package org.dey.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.dey.pojo.Role;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author deyran
 * @date 2022/3/14 20:03
 * @classname
 * @see
 */
@Repository
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select * from t_role where id in(select role_id from t_user_role where user_id = #{uid})")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "keyword",property = "keyword"),
            @Result(column = "description",property = "description")
    })
    List<Role> ROLE_ID(Integer uid);

}
